<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:gc="http://nz.co.kevindoran/googlecharts">

<h:head>
	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
	<!-- 	<script src="resources/js/bootstrap.js"></script> -->
	<script src="resources/js/bootstrap-tabs.js"></script>
	<script src="resources/js/limpiar.js"></script>

</h:head>
<body>
	<!-- 	<div class="span3"> -->

	<div>
		<div>
			<h:form rendered="#{userLogin.showAplicaciones()}">
				<table class="table table-bordered">
					<tr>
						<th>Nombre</th>
						<th>Descripcion</th>
					</tr>
					<tr>
						<td><h:outputText value="#{appSesBean.nombre}" /></td>
						<td><h:outputText value="#{appSesBean.descripcion}" /></td>
					</tr>
				</table>
				<table class="table table-bordered">
					<tr>
						<th>Cantidad de Usuarios</th>
					</tr>
					<tr>
						<td><h:outputText value="#{appSesBean.cantUsers()}" /></td>
					</tr>
				</table>
			</h:form>
		</div>
		<div>
			<table class="table table-bordered">
				<tr>
					<th>Agregar Canal</th>
				</tr>
				<tr>
					<td><h:form id="canalForm">
							<table class="table-bordered">
								<tr>
									<td><h:inputText value="#{canalBean.codigo}"
											style="height: 30px !important" id="canalNom" /></td>
									<td><h:commandButton action="#{canalBean.altaCanal()}"
											class="btn btn-primary" value="agregar" /></td>
									<td>
										<div class="alert-danger">
											<strong><h:message for="canalNom" showDetail="false"
													showSummary="true" /></strong>
										</div>
									</td>
								</tr>
							</table>
						</h:form></td>
				</tr>
			</table>
		</div>

		<table class="table table-bordered" cellpadding="4">
			<tr align="center">
				<th>Codigo del Canal</th>
				<th>Cantidad de Registrados</th>
				<th>Cantidad de Mensajes enviados</th>
				<th>Borrar Canal</th>
			</tr>
			<tr align="center">
				<h:form rendered="#{appSesBean.showCanales()}">
					<c:forEach var="c" items="#{appSesBean.getCanales()}">
						<tr>
							<td><h:outputText value="#{c.codigo}" /></td>

							<td><h:outputText value="#{c.registrados}" /></td>

							<td><h:outputText value="#{c.getMensajes()}" /></td>

							<td><h:commandButton class="btn btn-danger"
									action="#{c.borrarCanal}" value="borrar" /></td>
						</tr>
					</c:forEach>
				</h:form>
			</tr>
		</table>
	</div>


	<ui:include src="/Graficas.xhtml"></ui:include>
</body>
</html>
